import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '名字',
    align: "center",
    dataIndex: 'name',
    width: 100
  },
  {
    title: '年龄',
    align: "center",
    dataIndex: 'age',
    width: 80
  },
  {
    title: '性别',
    align: "center",
    dataIndex: 'sex_dictText',
    width: 80
  },
  {
    title: '职务',
    align: "center",
    dataIndex: 'position',
    width: 120
  },
  {
    title: '岗位',
    align: "center",
    dataIndex: 'post'
  },
  {
    title: '电话',
    align: "center",
    dataIndex: 'tel'
  },
  {
    title: '入职时间',
    align: "center",
    dataIndex: 'hireDate'
  },
  {
    title: '系统账户',
    align: "center",
    dataIndex: 'sysAccount_dictText'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "名字",
    field: 'name',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "职务",
    field: 'position',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '名字',
    field: 'name',
    component: 'Input',
  },
  {
    label: '年龄',
    field: 'age',
    component: 'InputNumber',
  },
  {
    label: '性别',
    field: 'sex',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "sex"
    },
  },
  {
    label: '职务',
    field: 'position',
    component: 'Input',
  },
  {
    label: '岗位',
    field: 'post',
    component: 'Input',
  },
  {
    label: '电话',
    field: 'tel',
    component: 'Input',
  },
  {
    label: '入职时间',
    field: 'hireDate',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '系统账户',
    field: 'sysAccount',
    component: 'JSearchSelect',
    componentProps:{
      dict: "sys_user,username,id"
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
